/*
 * @Description:
 * @Author: zhaolei
 * @Date: 2023-04-18 19:51:34
 */

import request from '@/router/axios';

// 获取广告列表
export function fetchList(params) {
  return request({
    url: '/operation/petadvertis/page',
    method: 'get',
    params,
  });
}

// 新增广告
export function addObj(data) {
  return request({
    url: '/operation/petadvertis',
    method: 'post',
    data,
  });
}

// 修改广告
export function putObj(data) {
  return request({
    url: '/operation/petadvertis',
    method: 'put',
    data,
  });
}

// 根据id查询广告
export function getObj(id) {
  return request({
    url: `/operation/petadvertis/${id}`,
    method: 'get',
  });
}

// 广告启用/禁用
export function updateAdvertisingStatus(data) {
  return request({
    url: `/operation/petadvertis/updateDisableFlagById`,
    method: 'put',
    data,
  });
}
//页面列表
export function selectPageList(params) {
  return request({
    url: '/operation/petadvertispage/page',
    method: 'get',
    params,
  });
}
//页面新增
export function insertPage(data) {
  return request({
    url: '/operation/petadvertispage',
    method: 'post',
    data,
  });
}
//通过id查询页面
export function selectPageById(id) {
  return request({
    url: `/operation/petadvertispage/${id}`,
    method: 'get',
  });
}
//页面修改
export function updatePage(data) {
  return request({
    url: '/operation/petadvertispage',
    method: 'put',
    data,
  });
}
//新增广告接口
export function insertPetAdvertis(data) {
  return request({
    url: '/operation/petadvertis',
    method: 'post',
    data,
  });
}
//修改广告接口
export function updatePetAdvertis(data) {
  return request({
    url: '/operation/petadvertis',
    method: 'put',
    data,
  });
}
//不分页 查询页面列表
export function selectList(params) {
  return request({
    url: '/operation/petadvertispage/allPage',
    method: 'get',
    params,
  });
}
